﻿using System.Runtime.CompilerServices;
namespace ABI
{
    [global::System.AttributeUsage(System.AttributeTargets.Method, Inherited = false, AllowMultiple = true)]
    sealed class MethodAliasAttribute : System.Attribute
    {
        public MethodAliasAttribute(string alias) { }
    }

    [global::System.AttributeUsage(System.AttributeTargets.Method, Inherited = false, AllowMultiple = true)]
    sealed class ExtraArgumentAttribute : System.Attribute
    {
        public ExtraArgumentAttribute(int arg_no, int base_type) { }
    }

    [global::System.AttributeUsage(System.AttributeTargets.Method, Inherited = false, AllowMultiple = true)]
    sealed class AlwaysCompileAttribute : System.Attribute
    { }

    [global::System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Enum, Inherited = false, AllowMultiple = true)]
    sealed class OutputCHeaderAttribute : System.Attribute
    { }

    class MemoryOperations
    {
        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
        internal static extern byte PeekU1(ulong addr);
        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
        internal static extern ushort PeekU2(ulong addr);
        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
        internal static extern void Poke(ulong addr, byte b);
        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
        internal static extern void Poke(ulong addr, ushort v);
    }

    class IoOperations
    {
        [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
        internal static extern void PortOut(ushort port, byte v);
    }

    class CastOperations
    {
        [MethodImpl(MethodImplOptions.InternalCall)]
        internal static extern Multiboot.Header ReinterpretAsMboot(ulong addr);

        [MethodImpl(MethodImplOptions.InternalCall)]
        internal static extern ulong GetArg0U8();
    }
}
